package com.ai.model.param;

import com.ai.common.vaild.AddGroup;
import com.ai.common.vaild.UpdateGroup;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.data.annotation.Transient;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Null;
import java.io.Serializable;

@Data
public class SysUserParam  implements Serializable {
    private static final long serialVersionUID = 1L;


    @ApiModelProperty("id")
    @NotBlank(message = "修改时Id不能为空",groups = {UpdateGroup.class})
    @Null(message = "新增时不可指定id",groups = {AddGroup.class})
    private  String id;

    @ApiModelProperty("账号")
    @NotBlank(message = "修改时账号名不能为空",groups = {UpdateGroup.class})
    @NotBlank(message = "新增时账号名不能为空",groups = {AddGroup.class})
    private String account;

    @ApiModelProperty("用户名")
    @NotBlank(message = "修改时用户名不能为空",groups = {UpdateGroup.class})
    @NotBlank(message = "新增时用户名不能为空",groups = {AddGroup.class})
    private String userName;

    @ApiModelProperty("用户密码")
//    @NotBlank(message = "修改时密码不能为空",groups = {UpdateGroup.class})
    @NotBlank(message = "新增时密码不能为空",groups = {AddGroup.class})
    private String password;


    @ApiModelProperty("创建人")
    private Integer createUser;

    @ApiModelProperty("修改人")
    private Integer updateUser;

    /**
     * 冗余字段，新增的用户角色
     */
    @Transient
    @NotBlank(message = "修改时角色不能为空",groups = {UpdateGroup.class})
    @NotBlank(message = "新增时用户角色不能为空",groups = {AddGroup.class})
    private String roleId;
}
